<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>cute-transfer: Client类参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- 制作者 Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
--></script>
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">cute-transfer</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li class="current"><a href="annotated.html"><span>类</span></a></li>
      <li><a href="files.html"><span>文件</span></a></li>
      <li id="searchli">
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="搜索" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>组合类型列表</span></a></li>
      <li><a href="classes.html"><span>组合类型索引</span></a></li>
      <li><a href="functions.html"><span>组合类型成员</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">公有成员</a> &#124;
<a href="#pub-static-methods">静态公有成员</a>  </div>
  <div class="headertitle">
<div class="title">Client类参考</div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="Client" -->
<p>客户端类  
 <a href="class_client.html#details">更多...</a></p>

<p><code>#include &lt;<a class="el" href="client_8h_source.html">client.h</a>&gt;</code></p>

<p><a href="class_client-members.html">所有成员的列表。</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
公有成员</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_client.html#a772c7deb25a57164e39f6c798140f21e">addConnection</a> (<a class="el" href="class_connection.html">Connection</a> *)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_client.html#a12eaa3ff4cac47109acb0764c0b689bf">startListen</a> (int lisPort=0)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_client.html#aef909de08ef481be9e915bd4deb81107">stopListen</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_client.html#abfd2a6d2e31f7ad05b6003b6900bedcc">startCon</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_client.html#a456d3e393b75a3409d2a4d2991365c33">startCon</a> (unsigned short port, const char *<a class="el" href="struct____addr.html">addr</a>, const int nRequest, const std::string &amp;str)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_client.html#adfe393bc28758353b25b900d9bb2ea7d">waitForCon</a> ()</td></tr>
<tr><td colspan="2"><h2><a name="pub-static-methods"></a>
静态公有成员</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="class_client.html">Client</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_client.html#ae57819d17e2d00f7235adcc99ca13d90">getSingleClient</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_client.html#a94b944a8f8349b58dd368deb964fceac">getPort</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_client.html#a7e8f83fbbe3efcd600f8fd8b2d993dd0">thread_accept</a> (void *arg)</td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>详细描述</h2>
<div class="textblock"><p>客户端类 </p>
<p><a class="el" href="client_8h_source.html">client.h</a> <a class="el" href="class_client.html" title="客户端类">Client</a> header</p>
<p>Lai </p>
<dl class="date"><dt><b>日期:</b></dt><dd>July 8 2011</dd></dl>
<p>This file is part of cute-transfer based cracker project, which released under the GNU GPL v2 or v3 (whichever you like) This project is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 单一实例对象 主要负责创建新连接，以及被动监听连接请求， 主动发送消息和文件。 </p>
</div><hr/><h2>成员函数文档</h2>
<a class="anchor" id="a772c7deb25a57164e39f6c798140f21e"></a><!-- doxytag: member="Client::addConnection" ref="a772c7deb25a57164e39f6c798140f21e" args="(Connection *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Client::addConnection </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_connection.html">Connection</a> *&#160;</td>
          <td class="paramname"><em>newCon</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>添加新Connection对象指针至列表 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname"><a class="el" href="class_connection.html" title="连接类">Connection</a></td><td>* 连接指针 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a94b944a8f8349b58dd368deb964fceac"></a><!-- doxytag: member="Client::getPort" ref="a94b944a8f8349b58dd368deb964fceac" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Client::getPort </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>返回本机客户端的监听端口 </p>
<dl><dt><b>返回值:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">int</td><td>监听端口号 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ae57819d17e2d00f7235adcc99ca13d90"></a><!-- doxytag: member="Client::getSingleClient" ref="ae57819d17e2d00f7235adcc99ca13d90" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_client.html">Client</a> * Client::getSingleClient </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>返回单一client对象的指针。 </p>
<dl><dt><b>返回值:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">Client*</td><td>client的指针 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a456d3e393b75a3409d2a4d2991365c33"></a><!-- doxytag: member="Client::startCon" ref="a456d3e393b75a3409d2a4d2991365c33" args="(unsigned short port, const char *addr, const int nRequest, const std::string &amp;str)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Client::startCon </td>
          <td>(</td>
          <td class="paramtype">unsigned short&#160;</td>
          <td class="paramname"><em>port</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int&#160;</td>
          <td class="paramname"><em>nRequest</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>str</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>连接接口，并处理指定请求 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">usigned</td><td>short 连接的端口 </td></tr>
    <tr><td class="paramname">const</td><td>char * 连接的地址，例如“127.0.0.1” </td></tr>
    <tr><td class="paramname">const</td><td>int 请求类型 0 发送消息 其他值 发送文件 </td></tr>
    <tr><td class="paramname">string</td><td>消息内容或者文件路径 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="abfd2a6d2e31f7ad05b6003b6900bedcc"></a><!-- doxytag: member="Client::startCon" ref="abfd2a6d2e31f7ad05b6003b6900bedcc" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Client::startCon </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>从命令行读入指令并执行 </p>

</div>
</div>
<a class="anchor" id="a12eaa3ff4cac47109acb0764c0b689bf"></a><!-- doxytag: member="Client::startListen" ref="a12eaa3ff4cac47109acb0764c0b689bf" args="(int lisPort=0)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Client::startListen </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>lisPort</em> = <code>0</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>开始监听本地端口 </p>
<dl><dt><b>返回值:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">int</td><td>0 监听成功 int -1 监听失败 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="aef909de08ef481be9e915bd4deb81107"></a><!-- doxytag: member="Client::stopListen" ref="aef909de08ef481be9e915bd4deb81107" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Client::stopListen </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>停止监听本地端口 </p>

</div>
</div>
<a class="anchor" id="a7e8f83fbbe3efcd600f8fd8b2d993dd0"></a><!-- doxytag: member="Client::thread_accept" ref="a7e8f83fbbe3efcd600f8fd8b2d993dd0" args="(void *arg)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void * Client::thread_accept </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>arg</em></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>被动阻塞监听外来连接请求的线程函数 </p>

</div>
</div>
<a class="anchor" id="adfe393bc28758353b25b900d9bb2ea7d"></a><!-- doxytag: member="Client::waitForCon" ref="adfe393bc28758353b25b900d9bb2ea7d" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Client::waitForCon </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>等待连接请求并处理 </p>

</div>
</div>
<hr/>该类的文档由以下文件生成：<ul>
<li>E:/CODE/CPPpro/cute-transfer/Msg&amp;FileTransfer/<a class="el" href="client_8h_source.html">client.h</a></li>
<li>E:/CODE/CPPpro/cute-transfer/Msg&amp;FileTransfer/client.cpp</li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>全部</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>类</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>函数</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>变量</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>类型定义</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>枚举</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>枚举值</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr class="footer"/><address class="footer"><small>Generated at 2011年七月8日 星期五 15:50:02 for cute-transfer by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>
